package cate.common.table.activity.dungeonup;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.util.random.RWItem;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "卡牌奖励池")
public class DURewardRow extends ERow implements RWItem {
    @NoteField(value = "组别")
    public int group;

    @NoteField(value = "物品")
    public String rewardStr;

    @NoteField(value = "权重")
    public int weight;

    @NoteField(value = "类别")
    public int type;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID");
        this.group = xrw.getInteger("组别", 1);
        this.rewardStr = xrw.getString("物品", "");
        this.weight = xrw.getInteger("权重", 0);
        this.type = xrw.getInteger("类别");
    }

    @Override
    public double getWeight() {
        return weight;
    }
}
